import instance from '../index'

const prefix = '/contact'

// 创建收件地址
export const createContact = (data) => {
  return instance({
    url: `${prefix}/create`,
    method: 'post',
    data
  })
}

// 获取收件地址列表
export const getContactList = (params) => {
  return instance({
    url: `${prefix}/list`,
    method: 'get',
    params
  })
}

// 获取单个收件地址
export const getOneContact = (params) => {
  return instance({
    url: `${prefix}/getOne`,
    method: 'get',
    params
  })
}
// 修改单个收件地址
export const updateAddress = (data) => {
  return instance({
    url: `${prefix}/update`,
    method: 'post',
    data
  })
}
// 获取单个收件地址
export const delAddress = (data) => {
  return instance({
    url: `${prefix}/delete`,
    method: 'post',
    data
  })
}
